package lu.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import lombok.Data;

import java.util.List;

@Data
public class Teacher {
    /**
     * 老师的主键
     *
     * 不需要导入导出的数据 可以不添加@Excel 注解
     */
    private Integer teacherId;
    /**
     * 名字
     * @Excel 定义导出之后Excel中列的情况
     * name 定义导出之后Excel中列的名字
     */
    @Excel(name = "老师名字")
    private String teacherName;
    /**
     * 头像图片地址
     *
     * 表示type =2 该字段类型为图片,imageType=1 (默认可以不填),表示从file读取,
     * 字段类型是个字符串类型 可以用相对路径也可以用绝对路径,绝对路径优先依次获取
     *
     */
    @Excel(name = "老师图片",type = 2 ,width = 40 , height = 20,imageType = 1)
    private String teacherImage;
    /**
     * 老师的状态 0代表正常 1代表删除
     *
     * replace 值的替换
     */
    @Excel(name = "老师的状态",replace = {"正常_0","冻结_1"})
    private Integer teacherStatus;

    @ExcelCollection(name = "学生数据")
    public List<Student> students;


    public Teacher(Integer teacherId, String teacherName, String teacherImage, Integer teacherStatus, List<Student> students) {
        this.teacherId = teacherId;
        this.teacherName = teacherName;
        this.teacherImage = teacherImage;
        this.teacherStatus = teacherStatus;
        this.students = students;
    }

    public Teacher(Integer teacherId, String teacherName, String teacherImage, Integer teacherStatus) {
        this.teacherId = teacherId;
        this.teacherName = teacherName;
        this.teacherImage = teacherImage;
        this.teacherStatus = teacherStatus;
    }

    public Teacher() {
    }
}
